<?php
/**
 * Created by Engineer CuiLiwu.
 * Project: deal.
 * Date: 2018/6/20-14:59
 * License Hangzhou orce Technology Co., Ltd. Copyright © 2018
 */

namespace App\Http\Controllers\Backend\Im;

use App\ConstDir\ErrorConst;
use App\Http\Controllers\Backend\BaseController;
use App\Repository\Repositories\Interfaces\UserImRecordRepository;
use Illuminate\Http\Request;
use Prettus\Repository\Criteria\RequestCriteria;

class ImRecordController extends BaseController
{

    /**
     * @var UserImRecordRepository
     */
    protected $userImRecord_repo;
    protected $request;

    public function __construct(UserImRecordRepository $userImRecord_repo, Request $request)
    {
        parent::__construct();
        $this->userImRecord_repo = $userImRecord_repo;
        $this->request = $request;
    }

    /**
     *  IM 聊天记录
     * */
    public function index(){
        $list = $this->userImRecord_repo->paginate($this->perPage);

        return $this->success(ErrorConst::SUCCESS_CODE, $list, true);
    }
    
    /**
     *  查看指定聊天记录
     * */
    public function show($id)
    {
        $record = $this->userImRecord_repo->find($id);
        return $this->success(ErrorConst::SUCCESS_CODE, $record['data']);
    }
    
    /**
     *  删除
     * */
    public function delete($id){

    }
}